home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1KDNHX8 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.9 KB  |  47 lines

  1. package com.sun.java.swing.plaf;
  2.  
  3. import com.sun.java.swing.JComponent;
  4. import java.awt.Component;
  5. import java.awt.Dimension;
  6. import java.awt.Graphics;
  7.  
  8. public abstract class ComponentUI {
  9.    public boolean contains(JComponent c, int x, int y) {
  10.       return ((Component)c).inside(x, y);
  11.    }
  12.  
  13.    public static ComponentUI createUI(JComponent c) {
  14.       throw new Error("ComponentUI.createUI not implemented.");
  15.    }
  16.  
  17.    public Dimension getMaximumSize(JComponent c) {
  18.       return this.getPreferredSize(c);
  19.    }
  20.  
  21.    public Dimension getMinimumSize(JComponent c) {
  22.       return this.getPreferredSize(c);
  23.    }
  24.  
  25.    public Dimension getPreferredSize(JComponent c) {
  26.       return null;
  27.    }
  28.  
  29.    public void installUI(JComponent c) {
  30.    }
  31.  
  32.    public void paint(Graphics g, JComponent c) {
  33.    }
  34.  
  35.    public void uninstallUI(JComponent c) {
  36.    }
  37.  
  38.    public void update(Graphics g, JComponent c) {
  39.       if (c.isOpaque()) {
  40.          g.setColor(((Component)c).getBackground());
  41.          g.fillRect(0, 0, c.getWidth(), c.getHeight());
  42.       }
  43.  
  44.       this.paint(g, c);
  45.    }
  46. }
  47.